<!DOCTYPE html>
<html>
<head>
    <title>Events</title>
    <meta charset="utf-8">
    <link href="../content/shared/styles/examples-offline.css" rel="stylesheet">
    <link href="../../styles/kendo.common.min.css" rel="stylesheet">
    <link href="../../styles/kendo.rtl.min.css" rel="stylesheet">
    <link href="../../styles/kendo.default.min.css" rel="stylesheet">
    <link href="../../styles/kendo.dataviz.min.css" rel="stylesheet">
    <link href="../../styles/kendo.dataviz.default.min.css" rel="stylesheet">
    <script src="../../js/jquery.min.js"></script>
    <script src="../../js/kendo.all.min.js"></script>
    <script src="../content/shared/js/console.js"></script>
    <script>
        
    </script>
    
    
</head>
<body>
    
        <a class="offline-button" href="../index.html">Back</a>
    
    
        <div id="example">

            <div class="box" style="margin-bottom: 30px;">                
                <h4>Console log</h4>
                <div class="console"></div>
            </div>

            <div id="window"></div>

            <span id="undo" style="display:none" class="k-button">Click here to open the window.</span>

            <script>
                function onOpen(e) {
                    kendoConsole.log("event :: open");
                }

                function onClose(e) {
                    $("#undo").show();
                    kendoConsole.log("event :: close");
                }

                function onActivate(e) {
                    kendoConsole.log("event :: activate");
                }

                function onDeactivate(e) {
                    kendoConsole.log("event :: deactivate");
                }

                function onRefresh(e) {
                    kendoConsole.log("event :: refresh");
                }

                function onResize(e) {
                    kendoConsole.log("event :: resize");
                }

                function onDragStart(e) {
                    kendoConsole.log("event :: dragstart");
                }

                function onDragEnd(e) {
                    kendoConsole.log("event :: dragend");
                }

                $("#undo")
                    .bind("click", function() {
                        $("#window").data("kendoWindow").open();
                        $("#undo").hide();
                    });

                $(document).ready(function() {
                    if (!$("#window").data("kendoWindow")) {
                        $("#window").kendoWindow({
                            width: "630px",
                            height: "315px",
                            title: "Rams's Ten Principles of Good Design",
                            actions: ["Refresh", "Close"],
                            content: "../content/web/window/ajax/ajaxContent1.html",
                            visible: false,
                            open: onOpen,
                            activate: onActivate,
                            close: onClose,
                            deactivate: onDeactivate,

                            refresh: onRefresh,

                            resize: onResize,
                            dragstart: onDragStart,
                            dragend: onDragEnd
                        }).data("kendoWindow").open();
                    }
                });
            </script>

            <style scoped>
                #example {
                    min-height:600px;
                }

                #undo {
                    text-align: center;
                    position: absolute;
                    white-space: nowrap;
                    border-width: 1px;
                    border-style: solid;
                    padding: 2em;
                    cursor: pointer;
                }
            </style>
        </div>

    
    
        <div class='demo-section'>
            <h3>Note:</h3>
            <p>
                Security restrictions prevent this example from working in all browsers when the page is loaded from the file system (via file:// protocol).
                If the demo is not working as expected, please host the Kendo folder on a web server.
            </p>
        </div>
    
</body>
</html>
